/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package snake;

import java.io.Serializable;

/**
 *
 * @author Ferenczy Máté
 */
public class Elem implements Serializable, Comparable<Elem> {
    private String nev;
    private long ido;
    private int pont;
    
    public Elem(String n, long p, long mp, int po)
    {
        nev=n;
        ido=p*60+mp;
        pont=po;
    }

    @Override
    public int compareTo(Elem o) {
        int i=-1;
        if (this.pont<o.pont)
            i=1;
        else
            if (this.pont==o.pont)
                if (this.ido>o.ido) i=1;
                else i=-1;
        return i;
    }

    public long getIdo()
    {
        return ido;
    }
    
    public int getPont()
    {
        return pont;
    }
    
    public String getNev()
    {
        return nev;
    }
}
